Ext.define('IHC.controller.ihc.cadastros.IHC002DetailFormController', {
	extend : 'Ext.app.Controller',
	
	requires : [
	    'IHC.model.Colaborador',
		'IHC.store.ihc.cadastros.IHC002Colaborador',
		'IHC.view.ihc.cadastros.IHC002DetailFormWindow'
	],
	
	views : [ 
	    'IHC.view.ihc.cadastros.IHC002DetailFormWindow' 
	],
	
	stores : [
	    'IHC.store.ihc.cadastros.IHC002Colaborador'
	],
	
	refs : [ {
		ref : 'hintToolbar',
		selector : '#ihc002-detail-hint-toolbar'
	}, {
		ref : 'windowRef',
		selector : '#ihc002-detail-window'
	}, {
		ref : 'formRef',
		selector : '#ihc002-detail-form'
	} ],
	
	mixins : [
	    'InsoftExtUi.ux.mixins.controller.CrudDetailFormMixin' 
	],
	
	init : function() {
		var me = this;
		me.initController('IHC.store.ihc.cadastros.IHC002Colaborador');
	},
	
	actionIndex : function(mode, record) {
		var me = this, 
			window = me.createWindow();
		mode = mode || 'I';
		
		if (mode === 'I') {
			record = Ext.create('IHC.model.Colaborador');
		}
		
		me.openWindow({
			window : window,
			mode : mode,
			record : record
		});
	},
	
	setExtraValues : function(form, record) {
		var me = this;
		record.set('equipe', { id: me.masterRecord.get('id') });
	}
});
